package cn.howxu.yichen_ovo.common.item;

import cn.howxu.yichen_ovo.client.util.ColorText;
import net.minecraft.ChatFormatting;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @description: TODO
 * @author: HowXu
 * @date: 2025/9/22 12:14
 */
public class ALBookItem extends BlockItem {
    public ALBookItem(Block pBlock) {
        super(pBlock, new Properties().rarity(Rarity.EPIC));
    }

    @Override
    public EquipmentSlot getEquipmentSlot(ItemStack stack) {
        return EquipmentSlot.HEAD;
    }

    @Override
    public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltip, TooltipFlag pFlag) {
        super.appendHoverText(pStack, pLevel, pTooltip, pFlag);
        pTooltip.add(Component.literal(ColorText.makeFabulous(I18n.get("tip.yichenovo.albook"))));
        pTooltip.add(Component.translatable("tip.yichenovo.albook2"));
        pTooltip.add(Component.translatable("tip.yichenovo.record").withStyle(ChatFormatting.GOLD));
    }
}
